package com.liu.efk.task;

import com.liu.efk.service.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by shi860715@126.com
 * Date 2021/3/6 12:00
 * Description
 */
@EnableScheduling
@Configuration
@Component
@Slf4j
public class RedisTask {

    @Autowired
    RedisService redisService;

    @Scheduled(cron = "0/50 * * * * ?")
//    指定5s钟执行一次
    public void redisTaskProject(){

        log.info("执行项目表缓存");
        redisService.setRedisCodeProject();
        log.info("角色缓存表");
        redisService.setRedisROles();
        log.info("执行用户信息表");
        redisService.setRedisUserInfo();




    }





}
